package cn.ncu.wechat.controller;

import cn.ncu.wechat.model.MemberLevel;
import cn.ncu.wechat.service.MemberLevelService;
import cn.ncu.wechat.util.Result;
import cn.ncu.wechat.vo.MemberLevelVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/admin/member-levels")
public class MemberLeveController {
    @Autowired
    private MemberLevelService memberLevelService;

    @GetMapping("")
    public Result<?> getMemberLevels(){
        return memberLevelService.getMemberLevelsDetail();
    }

    @PostMapping("")
    public Result<?> updateOrAddMemberLevels(@RequestBody MemberLevelVo memberLevelVo){
        return memberLevelService.updateOrAddMemberLevels(memberLevelVo);
    }
}
